#include<iostream>
#include<cmath>
using namespace std;

int main()
{
	int n = 0;
	int cnt = 0;
	cin >> n;
	
	int i = 2;
	while(1)
	{
		int flag = 1;
		for(int j = 2;j <= sqrt(i);j++)
		{
			if(i % j == 0)
			{
				flag = 0;
				break;
			}
		}
		
		if(flag == 1)
			cnt++;
		
		if(cnt == n)
			break;
		i++;
	}
	cout << i << endl;
	return 0;
}
